#include <stdio.h>

#define IN  1    /* inside a word */
#define OUT 0    /* outside a word */

/* prints input one word per line */
main()
{
    int c, state=OUT;
        
    while((c = getchar()) != EOF)
    {
        if(c == ' ' || c == '\t')
            state = OUT;
        else if(state == OUT)
        {
            state = IN;
            putchar('\n');
            putchar(c);
        }
        else if(state == IN)
            putchar(c);
    }
}
